import yesmola from "./index.module.css"
import React, { Component } from 'react'
import 'antd/dist/antd.css';

import {Route,Link} from 'react-router-dom'
// import {Route,Link} from "react-router-dom"
import Admin from "../../components/admin"
import Tou from "../../components/Tou"
import Shou from "../../components/Shou"
import Invest from "../Invest"
import Notice from "../notice"
import Cash from "../Cash"
import User from "../User"
import Item from "../Item"



import {UserOutlined, LaptopOutlined, NotificationOutlined } from '@ant-design/icons';

import { Layout, Menu } from 'antd';
const { Header, Content, Footer, Sider } = Layout;

const { SubMenu } = Menu;



export default class Home extends Component {
    constructor(props) {
        super(props);
        this.state = {
        }
    }
    componentDidMount(){
        let asd = sessionStorage.getItem("key")
        console.log("asd存储验证",asd)
        if(!asd){
            this.props.history.push({pathname:'/'})
        }
    }
    render() {
        return (
            <div id={yesmola.box}>
                <Layout>
                    <Header style={{ position: 'fixed', zIndex: 1, width: '100%' }}>
                        <div className="logo" />
                        <Menu theme="dark" mode="horizontal" defaultSelectedKeys={['2']}>
                            <Menu.Item key="1">
                                头像预留
                            </Menu.Item>
                            <Menu.Item key="2">
                                用户名
                            </Menu.Item>
                        </Menu>
                    </Header>
                    <Layout>
                        <Sider
                            style={{
                                overflow: 'auto',
                                height: '100vh',
                                position: 'fixed',
                                left: 0,
                                top: 10
                            }}
                        >
                            <div className="logo" />
                            <Menu theme="dark" mode="inline" defaultSelectedKeys={['4']}>
                                <Menu.Item key="4" icon={<UserOutlined />}>
                                    nav 1
                                </Menu.Item>
                                <Menu.Item key="5" icon={<LaptopOutlined />}>
                                    <Link to='/shou'> 首页 </Link> 
                                </Menu.Item>
                                <Menu.Item key="1" icon={<UserOutlined />}>
                                    <Link to='/tou'>我的</Link>  
                                </Menu.Item>
                                <Menu.Item key="2" icon={<UserOutlined />}>
                                    <Link to='/Notice'>通知管理</Link>
                                </Menu.Item>
                                <Menu.Item key="3" icon={<NotificationOutlined />}>
                                    <Link to='/invest'>区域投资</Link> 
                                </Menu.Item>
                                <Menu.Item key="6" icon={<NotificationOutlined />}>
                                    <Link to='/admin'>账号管理</Link>    
                                </Menu.Item>
                                <Menu.Item key="7" icon={<NotificationOutlined />}>
                                    <Link to='/cash'>资金流水</Link>
                                </Menu.Item>
                                <Menu.Item key="8" icon={<NotificationOutlined />}>
                                    <Link to='/User'>用户信息管理</Link>
                                </Menu.Item>
                                <Menu.Item key="9" icon={<NotificationOutlined />}>
                                    <Link to='/Item'>项目信息</Link>
                                </Menu.Item>
                            </Menu>
                        </Sider>
                        <Layout className="site-layout" style={{ marginLeft: 200,minHeight: '100vh' }}>
                            <Header className="site-layout-background" style={{ padding: 0 }} />
                            <Content style={{ margin: '24px 16px 0', overflow: 'initial' }}>
                                <div className="site-layout-background" style={{textAlign: 'left'}}>
                                    {/* <Invest /> */}
                                    {/* <div style={{marginTop: 150}}> */}
                                    <Route path="/shou" component={Shou} />
                                    <Route path="/tou" component={Tou} />
                                    <Route path="/admin" component={Admin} />
                                    <Route path="/invest" component={Invest} />
                                    <Route path="/Notice" component={Notice} />
                                    <Route path="/cash" component={Cash} />
                                    <Route path="/User" component={User} />
                                    <Route path="/Item" component={Item} />
                                    {/* </div> */}
                                </div>
                            </Content>
                            <Footer style={{ textAlign: 'center' }}>Ant Design ©2018 Created by Ant UED</Footer>
                        </Layout>
                    </Layout>
                </Layout>
            </div>
        )
    }
}
